<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var twoSum = function(numbers, target) {
    for( var i = 0 ; numbers[i]<=target ; i++ ){
        for(var j = 0 ; numbers[j]<=target ; j++ ){
            if( numbers[i] + numbers[j] == target && i != j ){
                return [i+1,j+1]
            }
        }
    }
    for( var i = 0 ; i<numbers.length ; i++ ){
        for(var j = 0 ; j<numbers.length ; j++ ){
            if( numbers[i] + numbers[j] == target && i != j ){
                return [i+1,j+1]
            }
        }
    }
};
var numbers = [2, 7, 11, 15]
var target = 9
console.log(twoSum(numbers, target))
    </script>
</body>
</html>